using UnityEngine;
using System.Collections;
using System;
using System.Runtime.InteropServices;

/// 阿里广告
public class AliAds : AdsBase
{
	public override void Init (params string[] key)
	{
		TJLog ("初始化阿里Banner key = " + key [0]);

		#if UNITY_IPHONE
		InitAlimamaiOS (key [0]);
		#endif
	}

	public override void ShowBanner (Action<bool> act)
	{
		TJLog ("展示Banner");
		#if UNITY_IPHONE
		ShowAliBanner (true);
		#endif
	}

	public override void CloseBanner ()
	{
		TJLog ("关闭Banner");
		#if UNITY_IPHONE
		ShowAliBanner (false);
		#endif
	}


	[DllImport ("__Internal")]
	static extern void InitAlimamaiOS (string aliKey);

	[DllImport ("__Internal")]
	static extern void ShowAliBanner (bool show);
}